#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

use serde::{Deserialize, Serialize};
use tauri::Manager;

#[derive(Debug, Clone, Serialize, Deserialize)]
struct Message {
    text: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
struct IpAddress {
    ip: String,
}

fn main() {
    tauri::Builder::default()
    .plugin(tauri_plugin_network::init())
        .plugin(tauri_plugin_udp::init())
        .setup(|app| {
            #[cfg(debug_assertions)] // only include this code in debug builds
            {
              let window = app.handle().get_webview_window("main").unwrap();
              window.open_devtools();
              window.center().unwrap();
            }
            Ok(())
          })
        // .invoke_handler(tauri::generate_handler![get_local_ip_addresses])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
